package com.hliushi.learn.listener;

import com.hliushi.learn.bean.Reader;
import org.springframework.context.ApplicationEvent;

/**
 * @ClassName MyEvent
 * @Description 自定义事件
 * @Author liushi
 * @Date 2021/7/8 16:09
 * @Version V1.0
 **/
public class MyEvent extends ApplicationEvent {

    private static final long serialVersionUID = 8869143575185624727L;

    private Reader reader;

    public MyEvent(Object source, Reader reader) {
        super(source);
        this.reader = reader;
    }

    public MyEvent(Object source) {
        super(source);
    }

    public Reader getReader() {
        return reader;
    }

    public void setReader(Reader reader) {
        this.reader = reader;
    }

    @Override
    public String toString() {
        return "MyEvent{" +
                "reader=" + reader +
                '}';
    }
}
